package com.zkthink.ceres.order.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * 分销订单状态
 */
@Getter
public enum ProfitOrderTypeEnum {
    STATUS_1(1, "未确认收货"),
    STATUS_2(2, "确认收货，结算"),
    STATUS_3(3, "待退款"),
    STATUS_4(4, "已退款"),
    STATUS_5(5, "退款结算"),
    STATUS_6(6, "未确认收货，申请退款，--待退款"),
    STATUS_7(7, "确认收货之后，申请退款，--待退款"),
    STATUS_8(8, "确认退款，结算"),
    ;

    private int code;

    private String desc;

    ProfitOrderTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ProfitOrderTypeEnum getDscByType(Integer type) {
        for (ProfitOrderTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
